package com.nondo.dean.saprfc.controller;

import com.nondo.dean.common.annotation.ApiVersion;
import com.nondo.dean.common.web.View;
import com.nondo.dean.saprfc.common.Util;

import com.nondo.dean.saprfc.domain.TransferMainBean;
import com.nondo.dean.saprfc.service.CrmOrderTransmitService;
import com.nondo.dean.saprfc.service.CrmTransferDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author xiaofan
 * @Description: 经销商打款记录传输
 * @throws
 * @date 2018-04-2715:31
 * @Version 0.1
 */
@RestController
@RequestMapping("/{v}/saprfc/transfer")
public class CrmTransferDetailController {

    @Autowired
    CrmTransferDetailService crmTransferDetailService;

    /**
     * 将经销商打款记录传输到Sap
     * @param transferMainBean
     * @return
     */
    @ApiVersion(1)
    @RequestMapping("/transmit")
    public View<Map<String, String>> getTransferDetail(@RequestBody(required = false) TransferMainBean transferMainBean){
        View<Map<String, String>> view = new View<Map<String, String>>(20000,"传输成功");
        Map<String, String> newMap =  crmTransferDetailService.synTransferDetailToSap(transferMainBean, Util.SAP_CLIENT);
        view.setData(newMap);
        return  view;
    }

}
